package com.googlecode.lemyriapode.prgechecs.univers;

import com.googlecode.lemyriapode.prgechecs.univers.Domaine.Point;
import com.googlecode.lemyriapode.prgechecs.univers.Domaine.Vecteur;

import static com.googlecode.lemyriapode.prgechecs.univers.Domaine.Vecteur.*;
import static com.googlecode.lemyriapode.prgechecs.univers.Avatar.Action.*;


public class Chemin {

    public void enZigZag(Avatar A) {

        boolean collision = false;
        while (!(collision)) {
            while (!(collision)) {
                print(A);
                collision = A.sedeplace(1, est);
            }
            A.sedeplace(1, nord);
            collision = A.sedeplace(8, ouest);
        }
    }

    public void enEtoile(Avatar A, Point point_depart) throws CloneNotSupportedException {
        A.position = point_depart.copy();
        boolean collision = false;
        for (Vecteur dir : Direction) {
            print(A);
            while (!(collision)) {
                print(A);
                collision = A.sedeplace(1, dir);
            }

            A.position = point_depart.copy();
            collision = false;
        }
    }
}
